// 用户编写的头文件
#include "G4ImproveActionInitialization.hh"
#include "G4ImprovePrimaryGeneratorAction.hh"
#include "G4ImproveSteppingAction.hh"
#include "G4ImproveEventAction.hh"
#include "G4ImproveRunAction.hh"

void G4ImproveActionInitialization::BuildForMaster() const{

    G4ImproveRunAction* runAction = new G4ImproveRunAction;
    SetUserAction(runAction);
}

void G4ImproveActionInitialization::Build() const{

    // 将粒子发射的行为配置到runmanager中
    SetUserAction(new G4ImprovePrimaryGeneratorAction);

    // 将run行为配置到runmanager中
    G4ImproveRunAction* runAction = new G4ImproveRunAction;
    SetUserAction(runAction);

    // 将event行为配置到runmanager中
    G4ImproveEventAction* eventAction = new G4ImproveEventAction(runAction);  
    SetUserAction(eventAction);

    // 将step行为配置到runmanager中
    G4ImproveSteppingAction* steppingAction = new G4ImproveSteppingAction(eventAction);
    SetUserAction(steppingAction);
    
}